add_gdal_driver(TARGET gdal_OZI SOURCES ozidataset.cpp PLUGIN_CAPABLE_IF "NOT GDAL_USE_LIBZ_INTERNAL" NO_DEPS)
gdal_standard_includes(gdal_OZI)
target_compile_definitions(gdal_OZI PRIVATE -DHAVE_LIBZ -DZIP_SUPPORT)
if (GDAL_USE_LIBZ_INTERNAL)
  target_include_directories(gdal_OZI PRIVATE $<TARGET_PROPERTY:libz,SOURCE_DIR>)
else ()
  target_compile_definitions(gdal_OZI PRIVATE -DHAVE_ZLIB_H -DHAVE_ZLIB)
  target_include_directories(gdal_OZI PRIVATE ${ZLIB_INCLUDE_DIRS})
  gdal_target_link_libraries(TARGET gdal_OZI LIBRARIES ZLIB::ZLIB)
  if (MSVC)
    target_compile_definitions(gdal_OZI PRIVATE -DZLIB_DLL)
  endif ()
endif ()
